package com.example.gch.jnitest01;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private Myjni jni;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn1).setOnClickListener(this);
        jni = new Myjni();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn1: {
                String msg = jni.getStringByJni();
                Toast.makeText(this, msg, Toast.LENGTH_LONG).show();
            }
            break;

            default: {
                break;
            }
        }
    }
}
